﻿@model FTBS.Models.Entities.Film

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h2>Sửa thông tin phim</h2>

@using (Html.BeginForm("Edit", "Film", null, FormMethod.Post,
                              new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
      @Html.HiddenFor(model => model.FilmId)
 <table class="table striped bordered hovered" style="margin :0px 0px 0px 40px">
        <tr>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.Name, "Tên phim")
                </div>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Name)
                    <p style="color:red;font-size:10pt">@Html.ValidationMessageFor(model => model.Name)</p>
                </div>
            </td>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.Length, "Độ dài")
                </div>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Length)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Length)</p>
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.Nation, "Quốc gia")
                </div>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Nation)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Nation)</p>
                </div>
            </td>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.Director, "Đạo diễn phim")
                </div>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Director)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.Director)</p>
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.AgeLimit, "Lứa tuổi")
                </div>
                <div class="input-control text">
                    @Html.EditorFor(model => model.AgeLimit)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.AgeLimit)</p>
                </div>
            </td>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.Actor, "Các diễn viên tham gia")
                </div>
                <div class="input-control text">
                    @Html.EditorFor(model => model.Actor)
                   <p style="color: red; font-size: 10pt"> @Html.ValidationMessageFor(model => model.Actor)</p>
                </div>
            </td>
            </tr>
        <tr>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.CategoryId, "Thể loại")
                </div>
                  <div class="input-control select">
                      <div>
                          @Html.DropDownListFor(model => model.CategoryId, (SelectList)ViewBag.CategoryId)
                          <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.CategoryId)</p>
                      </div>
                  </div>

            </td>
            <td style="padding: 0px 10px 0px 20px">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.FormatId, "Định dạng")
                </div>
                <div class="input-control text">
                    <div class="input-control select">
                        <div>
                            @Html.DropDownListFor(model => model.FormatId, (SelectList)ViewBag.FormatId)
                            <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.FormatId)</p>
                        </div>
                    </div>
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding: 0px 10px 0px 20px" colspan="2">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.Description, "Miêu tả phim")
                </div>
                <div  class="input-control textarea">
                    @Html.TextAreaFor(model => model.Description)
            <p style="color:red;font-size:10pt">@Html.ValidationMessageFor(model => model.Description)</p>
                </div>
            </td>
        </tr>
        <tr>
            <td style="padding: 0px 10px 0px 20px" colspan="2">
                <div style="font-weight: bold">
                    @Html.LabelFor(model => model.ImageURL, "Hình ảnh")
                </div>
                 <div class="input-control file info-state" data-role="input-control"> 
                    <input id="ImagePath" title="Upload a product image" type="file" name="file" />
                    <input type="text" id="__input_file_wrapper__" readonly="" style="z-index: 1; cursor: default;">
                    <button class="btn-file" type="button"></button>
                </div>
                <div class="input-control text" style="display:none">
                    @Html.EditorFor(model => model.ImageURL)
                    <p style="color: red; font-size: 10pt">@Html.ValidationMessageFor(model => model.ImageURL)</p>
                </div>
            </td>
        </tr>
        <tr>
            <td align="center" colspan="2">
                <input class="large info" type="submit" value="Lưu" />
            </td>
        </tr>
    </table>           
   @Html.ActionLink("Quay lại", "Index")
}



